From abcce110895d767a16fb961a65e7c78f9213ca0d Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 24 Oct 2024 17:11:32 +0700
Subject: <iman> update pengajuan tempo

---
 src/pages/pengajuan-tempo/[status].jsx | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 src/pages/pengajuan-tempo/[status].jsx

(limited to 'src/pages/pengajuan-tempo/[status].jsx')

diff --git a/src/pages/pengajuan-tempo/[status].jsx b/src/pages/pengajuan-tempo/[status].jsx
new file mode 100644
index 00000000..8476d08a
--- /dev/null
+++ b/src/pages/pengajuan-tempo/[status].jsx
@@ -0,0 +1,32 @@
+import BasicLayout from '@/core/components/layouts/BasicLayout';
+import IsAuth from '@/lib/auth/components/IsAuth';
+import FinishTempoComponent from '@/lib/pengajuan-tempo/component/FinishTempo';
+import { useRouter } from 'next/router';
+import axios from 'axios';
+import Seo from '@/core/components/Seo';
+
+export async function getServerSideProps(context) {
+  const { tempo_id } = context.query;
+  await axios.post(
+    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo?formId=${tempo_id}`,
+    {},
+    { headers: context.req.headers }
+  );
+  return { props: {} };
+}
+
+export default function Finish() {
+  const router = useRouter();
+
+  return (
+    <>
+      <Seo title='Penhajuan Tempo Indoteknik.com' />
+
+      <IsAuth>
+        <BasicLayout>
+          <FinishTempoComponent query={router.query || {}} />
+        </BasicLayout>
+      </IsAuth>
+    </>
+  );
+}
-- 
cgit v1.2.3


From 9054afb2c842a1177dbcf0842aadf2ad14403cde Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 25 Oct 2024 09:04:25 +0700
Subject: <iman> update pengajuan tempo finsish

---
 src/pages/pengajuan-tempo/[status].jsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/pages/pengajuan-tempo/[status].jsx')

diff --git a/src/pages/pengajuan-tempo/[status].jsx b/src/pages/pengajuan-tempo/[status].jsx
index 8476d08a..a5c630da 100644
--- a/src/pages/pengajuan-tempo/[status].jsx
+++ b/src/pages/pengajuan-tempo/[status].jsx
@@ -7,11 +7,11 @@ import Seo from '@/core/components/Seo';
 
 export async function getServerSideProps(context) {
   const { tempo_id } = context.query;
-  await axios.post(
-    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo?formId=${tempo_id}`,
-    {},
-    { headers: context.req.headers }
-  );
+  // await axios.post(
+  //   `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo?formId=${tempo_id}`,
+  //   {},
+  //   { headers: context.req.headers }
+  // );
   return { props: {} };
 }
 
-- 
cgit v1.2.3


From 803d93cd36abdf5de5882ba9e9cda24e9a32ab80 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 31 Oct 2024 16:07:18 +0700
Subject: update pengajuan tempo fix suplier ids

---
 src/pages/pengajuan-tempo/[status].jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/pages/pengajuan-tempo/[status].jsx')

diff --git a/src/pages/pengajuan-tempo/[status].jsx b/src/pages/pengajuan-tempo/[status].jsx
index a5c630da..1ebf167b 100644
--- a/src/pages/pengajuan-tempo/[status].jsx
+++ b/src/pages/pengajuan-tempo/[status].jsx
@@ -20,7 +20,7 @@ export default function Finish() {
 
   return (
     <>
-      <Seo title='Penhajuan Tempo Indoteknik.com' />
+      <Seo title='Pengajuan Tempo Indoteknik.com' />
 
       <IsAuth>
         <BasicLayout>
-- 
cgit v1.2.3


From 0f84963214ee6dc5b5a44d945540826a66bec9e0 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 11 Dec 2024 11:51:45 +0700
Subject: <iman> update pengajuan tempo

---
 src/pages/pengajuan-tempo/[status].jsx | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(limited to 'src/pages/pengajuan-tempo/[status].jsx')

diff --git a/src/pages/pengajuan-tempo/[status].jsx b/src/pages/pengajuan-tempo/[status].jsx
index 1ebf167b..c97b5897 100644
--- a/src/pages/pengajuan-tempo/[status].jsx
+++ b/src/pages/pengajuan-tempo/[status].jsx
@@ -3,7 +3,9 @@ import IsAuth from '@/lib/auth/components/IsAuth';
 import FinishTempoComponent from '@/lib/pengajuan-tempo/component/FinishTempo';
 import { useRouter } from 'next/router';
 import axios from 'axios';
+import { useState, useEffect } from 'react';
 import Seo from '@/core/components/Seo';
+import { getAuth } from '~/libs/auth';
 
 export async function getServerSideProps(context) {
   const { tempo_id } = context.query;
@@ -16,8 +18,26 @@ export async function getServerSideProps(context) {
 }
 
 export default function Finish() {
+  const [isLoading, setIsLoading] = useState(true);
   const router = useRouter();
+  const auth = getAuth();
+  useEffect(() => {
+    if (!auth) {
+      const nextUrl = encodeURIComponent(router.asPath);
+      router.push(`/login?next=${nextUrl}`);
+    } else if (
+      (router.query.status == 'approve' || router.query.status == 'review') &&
+      auth.tempoProgres === ''
+    ) {
+      router.push('/pengajuan-tempo');
+    } else {
+      setIsLoading(false);
+    }
+  }, [auth]);
 
+  if (isLoading || !auth) {
+    return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia
+  }
   return (
     <>
       <Seo title='Pengajuan Tempo Indoteknik.com' />
-- 
cgit v1.2.3


From 40f762589601de0fe1d5b06164b2553ebdbf5ecd Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 11 Jan 2025 09:27:46 +0700
Subject: <iman> update code

---
 src/pages/pengajuan-tempo/[status].jsx | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

(limited to 'src/pages/pengajuan-tempo/[status].jsx')

diff --git a/src/pages/pengajuan-tempo/[status].jsx b/src/pages/pengajuan-tempo/[status].jsx
index c97b5897..fa0a1749 100644
--- a/src/pages/pengajuan-tempo/[status].jsx
+++ b/src/pages/pengajuan-tempo/[status].jsx
@@ -8,9 +8,9 @@ import Seo from '@/core/components/Seo';
 import { getAuth } from '~/libs/auth';
 
 export async function getServerSideProps(context) {
-  const { tempo_id } = context.query;
+  const { status } = context.query;
   // await axios.post(
-  //   `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo?formId=${tempo_id}`,
+  //   `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo/${status}`,
   //   {},
   //   { headers: context.req.headers }
   // );
@@ -25,11 +25,6 @@ export default function Finish() {
     if (!auth) {
       const nextUrl = encodeURIComponent(router.asPath);
       router.push(`/login?next=${nextUrl}`);
-    } else if (
-      (router.query.status == 'approve' || router.query.status == 'review') &&
-      auth.tempoProgres === ''
-    ) {
-      router.push('/pengajuan-tempo');
     } else {
       setIsLoading(false);
     }
-- 
cgit v1.2.3


From 76afb8aaa5d2aaaf68529e11e9ed4d003d953f76 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 14 Jan 2025 09:09:05 +0700
Subject: <iman> update pengajuan tempo

---
 src/pages/pengajuan-tempo/[status].jsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/pages/pengajuan-tempo/[status].jsx')

diff --git a/src/pages/pengajuan-tempo/[status].jsx b/src/pages/pengajuan-tempo/[status].jsx
index fa0a1749..29886892 100644
--- a/src/pages/pengajuan-tempo/[status].jsx
+++ b/src/pages/pengajuan-tempo/[status].jsx
@@ -9,11 +9,11 @@ import { getAuth } from '~/libs/auth';
 
 export async function getServerSideProps(context) {
   const { status } = context.query;
-  // await axios.post(
-  //   `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo/${status}`,
-  //   {},
-  //   { headers: context.req.headers }
-  // );
+  await axios.post(
+    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo/${status}`,
+    {},
+    { headers: context.req.headers }
+  );
   return { props: {} };
 }
 
-- 
cgit v1.2.3

